local Aloft = Aloft
if not Aloft then return end
local AloftModules = AloftModules
if not AloftModules then return end

-----------------------------------------------------------------------------

AloftModules:AddInitializer("AloftGuild", function()

if not Aloft:GetModule("GuildData", true) then return end
if not AloftLocale or not AloftLocale.AloftGuildDataOptions then return end

-----------------------------------------------------------------------------

local AloftGuildData = Aloft:GetModule("GuildData")

local L = AloftLocale.AloftGuildDataOptions

-----------------------------------------------------------------------------

Aloft.Options.args.data.args.guild =
{
	type = 'toggle',
	width = 'full',
	name = L["Save Guild Data"],
	desc = L["Stores guild information between sessions"],
	disabled = function(i) return not Aloft:IsEnabled() or not AloftGuildData:IsEnabled() or not AloftGuildData.db or not AloftGuildData.db.profile end,
	get = function(i) return AloftGuildData.db.profile.save end,
	set = AloftGuildData.SetSaveData,
}

-----------------------------------------------------------------------------

end)
